from django.db import models

# Create your models here.
class User(models.Model):
    name = models.CharField(max_length=128,unique=True)
    password = models.CharField(max_length=256)

    def __str__(self):
        return self.name

class Room(models.Model):
    name = models.CharField(max_length=128,unique=True)

    def __str__(self):
        return self.name

class Order(models.Model):
    create_time = models.DateTimeField(auto_now=True)
    user_id = models.ForeignKey('User',to_field='id', on_delete=models.CASCADE)
    room_id = models.ForeignKey('Room',to_field='id', on_delete=models.CASCADE)
    start_time = models.DateTimeField()
    end_time = models.DateTimeField()
